package org.knight.gearbox.controller;

import org.knight.gearbox.model.entity.DemoBizData;
import org.knight.gearbox.service.BizService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.management.Query;
import java.util.List;

@RestController
public class BizController {

    @Autowired
    private BizService bizService;

    @GetMapping("/doSomeBusiness")
    public ResponseEntity doSomeBusiness(DemoBizDataVO vo) {

        bizService.doSomeBusiness(vo);
        return ResponseEntity.ok().build();
    }


    @GetMapping("/queryBizData")
    public ResponseEntity queryBizData(QueryVO queryVO) {

       List<DemoBizData> datas =   bizService.queryBizData(queryVO);
        return ResponseEntity.ok(datas);
    }
}
